home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / ufw.postrm < prev    next >
Text File  |  2009-09-23  |  2KB  |  56 lines

  1. #!/bin/sh -e
  2.  
  3. RULES_PATH="/etc/ufw"
  4. USER_PATH="/lib/ufw"
  5. case "$1" in
  6.     remove)
  7.         ;;
  8.  
  9.     purge)
  10.         if [ -e /usr/share/debconf/confmodule ]; then
  11.             . /usr/share/debconf/confmodule
  12.             db_purge
  13.         fi
  14.  
  15.         for f in before.rules before6.rules after.rules after6.rules
  16.         do
  17.             if which ucf > /dev/null 2>&1; then
  18.                 ucf -p $RULES_PATH/$f
  19.             fi
  20.             rm -f $RULES_PATH/$f
  21.             rm -f $RULES_PATH/$f.ucf-old $RULES_PATH/$f.ucf-new $RULES_PATH/$f.ucf-dist
  22.         done
  23.         rm -f $RULES_PATH/ufw.rules $RULES_PATH/ufw.rules.dpkg-old
  24.         rm -f $USER_PATH/user.rules $USER_PATH/user6.rules
  25.         rm -f /etc/ufw/ufw.conf
  26.  
  27.         # go back to default accept
  28.         for exe in iptables ip6tables
  29.         do
  30.             if which $exe > /dev/null 2>&1; then
  31.                 $exe -F 2>/dev/null || true
  32.                 $exe -X 2>/dev/null || true
  33.                 $exe -P INPUT ACCEPT 2>/dev/null || true
  34.                 $exe -P OUTPUT ACCEPT 2>/dev/null || true
  35.                 $exe -P FORWARD ACCEPT 2>/dev/null || true
  36.             fi
  37.         done
  38.         ;;
  39.  
  40.     upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
  41.         ;;
  42.  
  43.     *)
  44.         echo "postrm called with unknown argument '$1'" >&2
  45.         exit 1
  46.         ;;
  47. esac
  48.  
  49. # Automatically added by dh_installdebconf
  50. if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
  51.     . /usr/share/debconf/confmodule
  52.     db_purge
  53. fi
  54. # End automatically added section
  55.  
  56.